package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.dto.StatisGroupByYewLevel;
import com.ruoyi.system.dto.WcSysUserEx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WcSysUserMapper;
import com.ruoyi.system.domain.WcSysUser;
import com.ruoyi.system.service.IWcSysUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 小程序端用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-01-20
 */
@Service
public class WcSysUserServiceImpl implements IWcSysUserService 
{
    @Autowired
    private WcSysUserMapper wcSysUserMapper;

    @Override
    public Long countSysUser() {
        return wcSysUserMapper.count();
    }

    @Override
    public List<StatisGroupByYewLevel> statisticsUnderling(Integer userId) {
        return wcSysUserMapper.statisticsUnderling(userId);
    }

    /**
     * 查询小程序端用户
     * 
     * @param id 小程序端用户ID
     * @return 小程序端用户
     */
    @Override
    public WcSysUser selectWcSysUserById(Integer id)
    {
        return wcSysUserMapper.selectWcSysUserById(id);
    }

    /**
     * 查询小程序端用户列表
     * 
     * @param wcSysUser 小程序端用户
     * @return 小程序端用户
     */
    @Override
    public List<WcSysUser> selectWcSysUserList(WcSysUser wcSysUser)
    {
        return wcSysUserMapper.selectWcSysUserList(wcSysUser);
    }

    /**
     * 新增小程序端用户
     * 
     * @param wcSysUser 小程序端用户
     * @return 结果
     */
    @Override
    public int insertWcSysUser(WcSysUser wcSysUser)
    {
        return wcSysUserMapper.insertWcSysUser(wcSysUser);
    }

    /**
     * 修改小程序端用户
     * 
     * @param wcSysUser 小程序端用户
     * @return 结果
     */
    @Override
    public int updateWcSysUser(WcSysUser wcSysUser)
    {
        return wcSysUserMapper.updateWcSysUser(wcSysUser);
    }

    /**
     * 删除小程序端用户对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWcSysUserByIds(String ids)
    {
        return wcSysUserMapper.deleteWcSysUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除小程序端用户信息
     * 
     * @param id 小程序端用户ID
     * @return 结果
     */
    @Override
    public int deleteWcSysUserById(Integer id)
    {
        return wcSysUserMapper.deleteWcSysUserById(id);
    }
}
